<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Lightweight OS (LWOS): lwos.c File Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">Lightweight OS (LWOS)
   
   </div>
   <div id="projectbrief">A diminutive operating system</div>
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.6.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a> &#124;
<a href="#var-members">Variables</a>  </div>
  <div class="headertitle">
<div class="title">lwos.c File Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Main library source for LWOS.  
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &lt;stdlib.h&gt;</code><br/>
<code>#include &quot;<a class="el" href="lwos_8h_source.html">lwos.h</a>&quot;</code><br/>
</div><table class="memberdecls">
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="lwos_8c.html#a0ddf1224851353fc92bfbff6f499fa97">main</a> (int argc, char *argv[])</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">The LWOS-defined main just calls <em>task_init</em>.  <a href="#a0ddf1224851353fc92bfbff6f499fa97"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="lwos_8c.html#a2d5f6c88428ff65ce252e63964752e76">task_init</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">This function is usually called by main and forms the basic OS logic.  <a href="#a2d5f6c88428ff65ce252e63964752e76"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="var-members"></a>
Variables</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="lwos_8c.html#abbf01dbc8a3f47fd82f6c2afd53987ca">task_tick</a> = 0</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">User defined tick counter (must be signed)  <a href="#abbf01dbc8a3f47fd82f6c2afd53987ca"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">unsigned int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="lwos_8c.html#a8934693a5bbb067fec2dc3325430d1f9">task_num</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Current task number.  <a href="#a8934693a5bbb067fec2dc3325430d1f9"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="lwos_8h.html#af41b315a18a5782b8182db98ab85c5b7">Task</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="lwos_8c.html#a3b6d2a771ddc14909fe529c79622be1f">task_current</a> = NULL</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Pointer to current task.  <a href="#a3b6d2a771ddc14909fe529c79622be1f"></a><br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>Main library source for LWOS. </p>
<dl class="author"><dt><b>Author:</b></dt><dd>Al Williams </dd></dl>
<dl class="date"><dt><b>Date:</b></dt><dd>30 Oct 2012 Lightweight OS by Al Williams (<a href="mailto:al.williams@awce.com">al.williams@awce.com</a>) A very simple "OS" written in ordinary C that provides cooperative multitasking and is simple enough to port to very small microcontrollers that have a C compiler</dd></dl>
<p>The lwos file has its own <a class="el" href="lwos_8c.html#a0ddf1224851353fc92bfbff6f499fa97" title="The LWOS-defined main just calls task_init.">main()</a> (although you can suppress this by defining LWOS_NOMAIN.</p>
<p>This file is part of LWOS.</p>
<p>LWOS is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.</p>
<p>This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.</p>
<p>You should have received a copy of the GNU General Public License along with this program. If not, see &lt;<a href="http://www.gnu.org/licenses/">http://www.gnu.org/licenses/</a>&gt;. </p>
</div><hr/><h2>Function Documentation</h2>
<a class="anchor" id="a0ddf1224851353fc92bfbff6f499fa97"></a><!-- doxytag: member="lwos.c::main" ref="a0ddf1224851353fc92bfbff6f499fa97" args="(int argc, char *argv[])" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="lwos_8c.html#a0ddf1224851353fc92bfbff6f499fa97">main</a> </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>argc</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>argv</em>[]&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>The LWOS-defined main just calls <em>task_init</em>. </p>

</div>
</div>
<a class="anchor" id="a2d5f6c88428ff65ce252e63964752e76"></a><!-- doxytag: member="lwos.c::task_init" ref="a2d5f6c88428ff65ce252e63964752e76" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="lwos_8h.html#a2d5f6c88428ff65ce252e63964752e76">task_init</a> </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>This function is usually called by main and forms the basic OS logic. </p>
<p>Start LWOS -- typically called from default main. </p>

</div>
</div>
<hr/><h2>Variable Documentation</h2>
<a class="anchor" id="a3b6d2a771ddc14909fe529c79622be1f"></a><!-- doxytag: member="lwos.c::task_current" ref="a3b6d2a771ddc14909fe529c79622be1f" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="lwos_8h.html#af41b315a18a5782b8182db98ab85c5b7">Task</a>* <a class="el" href="lwos_8h.html#a3b6d2a771ddc14909fe529c79622be1f">task_current</a> = NULL</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Pointer to current task. </p>
<p>Current running task (used by many macros; also passed as an argument to the task </p>

</div>
</div>
<a class="anchor" id="a8934693a5bbb067fec2dc3325430d1f9"></a><!-- doxytag: member="lwos.c::task_num" ref="a8934693a5bbb067fec2dc3325430d1f9" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">unsigned int <a class="el" href="lwos_8h.html#a7c6e943398bf748ba97367e4b250d56f">task_num</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Current task number. </p>
<p>Current running task (as an index into <em>task_table</em>) </p>

</div>
</div>
<a class="anchor" id="abbf01dbc8a3f47fd82f6c2afd53987ca"></a><!-- doxytag: member="lwos.c::task_tick" ref="abbf01dbc8a3f47fd82f6c2afd53987ca" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="lwos_8h.html#abbf01dbc8a3f47fd82f6c2afd53987ca">task_tick</a> = 0</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>User defined tick counter (must be signed) </p>
<p>This is set by (usually) one user task to represent time in some way (e.g., # of seconds or milliseconds) </p>

</div>
</div>
</div><!-- contents -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>



<hr class="footer"/><address class="footer"><small>
Generated on Mon Nov 19 2012 22:30:11 for Lightweight OS (LWOS) by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.6.1
</small></address>

</body>
</html>
